package com.lj.back.manage.scaffold.module.sys.util;

import com.lj.back.manage.scaffold.module.sys.DTO.SysUserDTO;
import org.apache.shiro.SecurityUtils;

/**
 * @author lv
 * @version 1.0.0
 */
public class SysCommonUtil {

    private SysCommonUtil(){}

    /**
     * 获取当前用户
     * @return
     */
    public static SysUserDTO getUser(){
        return (SysUserDTO) SecurityUtils.getSubject().getPrincipal();
    }

    /**
     * 获取用户ID
     * @return
     */
    public static Long getUserId(){
        return getUser().getId();
    }
}
